// Copyright 2010 Google Inc. All Rights Reserved.

package com.google.zahra;

import com.google.zahra.workmanager.ZahraWorker;

import com.tc.util.runtime.Os;

import commonj.work.WorkException;

/**
 * @author arthurkok@google.com (Your Name Here)
 *
 */
public class Worker {
  
  /**
   * Main entry point for the Worker. No arguments required by the Worker.
   * @param args
   */
  public static void main(String[] args) {

    System.out.println("-- starting worker...");
    System.out.println("-- kill it with ^C when finished");
    int os = 0;
    
    // Detects which OS the machine is running
    if (Os.isWindows()) {
      System.out.println("This is Windows");
      os = 1;
    } else if (Os.isMac()) {
      System.out.println("This is Mac");
      os = 2;
    } else if (Os.isUnix()) {
      System.out.println("This is Unix or Linux");
      os = 4;
    } else {
      System.out.println("Your OS is not supported!!");
      return;
    }       

    ZahraWorker zahraWorker = new ZahraWorker(os);

    try {
      zahraWorker.start();
    } catch (WorkException e) {
      e.printStackTrace();
    }
  }
}
